package com.pls.entity;

import java.io.BufferedReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import com.pls.main.ProgramHelper;

public class Menu {
	private Map<Integer, String> menuList;

	public Menu() {
		setMenuList();
	}

	public Map<Integer, String> getMenuList() {
		return menuList;
	}

	public void setMenuList() {
		Map<Integer, String> menuList = new HashMap<Integer, String>();
		menuList.put(1, "Search Employee");
		menuList.put(2, "Update Employee Seat");
		menuList.put(3, "Delete Employee Seat");
		menuList.put(4, "EXIT");
		this.menuList = menuList;
	}

	public int populateMenuList(BufferedReader reader) {
		int command = 0;
		ProgramHelper helper = new ProgramHelper();
		for (int i = 0; i < getMenuList().size(); i++) {
			System.out.println("[" + (i + 1) + "]" + getMenuList().get(i + 1));
		}
		
		try {
			command = helper.executeIntRangeParseReader(reader, "Enter Command: ",
					"Please Enter A Valid Number From  The List", getMenuList().size());
			

		} catch (IOException e) {
			System.out.println(e);
		}
		
		return command;

	}

}
